package com.carful.xigua.modules.user.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.carful.v10.entity.HyInfo;
import com.carful.xigua.modules.user.entity.User;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.util.List;

/**
 * <p>
 * 用户 服务类
 * </p>
 *
 * @author ad
 * @since 2024-04-07
 */
public interface IUserService extends IService<User> {
    void init();

    User selectOne(String username);

    User daoLogin(User user);

    boolean daoLogout(HttpServletRequest request, HttpServletResponse response);

    boolean updPassword(String oldPassword, String newPassword);

    String bindPhone(User user, String token, String phone, String phoneCode);

    /**
     * openid 获取用户，没有直接创建
     * @param openid
     * @return
     */
    User getUserByOpenid(String openid);

    /**
     * 获取领取西瓜 code
     * @return
     */
    String getXiguaCode(String username);

    /**
     * 领取西瓜 生成记录
     * @param username 领取人
     * @param user 核验人
     * @return
     */
    String getXigua(String username, User user);

    /**
     * 手机号登录,并注册
     * @param phone
     * @return
     */
    User phoneLogin(String phone);

    /**
     * 排序会员信息
     * @param memberInfo
     * @return
     */
    List<HyInfo> sortHyInfo(List<HyInfo> memberInfo);


}
